<?php 
add_action( 'admin_enqueue_scripts', 'import_epanel_javascript' );
function import_epanel_javascript( $hook_suffix ) {
	if ( 'admin.php' == $hook_suffix && 'wordpress' == $_GET['import'] && '1' == $_GET['step'] )
		add_action( 'admin_head', 'admin_headhook' );
}

function admin_headhook(){ ?>
	<script type="text/javascript">
		jQuery(document).ready(function($){
			$("p.submit").before("<p><input type='checkbox' id='importepanel' name='importepanel' value='1' style='margin-right: 5px;'><label for='importepanel'>Import epanel settings</label></p>");
		});
	</script>
<?php }

add_action('import_end','importend');
function importend(){
	if ( !isset($_POST['importepanel']) )
		return;
	
	$importOptions = 'YToxMTE6e3M6MDoiIjtOO3M6MTQ6Im15Y3Vpc2luZV9sb2dvIjtzOjA6IiI7czoxNzoibXljdWlzaW5lX2Zhdmljb24iO3M6MDoiIjtzOjIyOiJteWN1aXNpbmVfY29sb3Jfc2NoZW1lIjtzOjc6IkRlZmF1bHQiO3M6MjA6Im15Y3Vpc2luZV9ibG9nX3N0eWxlIjtOO3M6MjA6Im15Y3Vpc2luZV9ncmFiX2ltYWdlIjtOO3M6MjY6Im15Y3Vpc2luZV9leGxjYXRzX21lbnVwYWdlIjthOjM6e2k6MDtzOjE6IjUiO2k6MTtzOjE6IjYiO2k6MjtzOjE6IjEiO31zOjIzOiJteWN1aXNpbmVfbWVudV9udW1wb3N0cyI7czoxOiIzIjtzOjIzOiJteWN1aXNpbmVfY3VycmVuY3lfc2lnbiI7czoxOiIkIjtzOjIyOiJteWN1aXNpbmVfY2F0bnVtX3Bvc3RzIjtzOjE6IjYiO3M6MjY6Im15Y3Vpc2luZV9hcmNoaXZlbnVtX3Bvc3RzIjtzOjE6IjUiO3M6MjU6Im15Y3Vpc2luZV9zZWFyY2hudW1fcG9zdHMiO3M6MToiNSI7czoyMjoibXljdWlzaW5lX3RhZ251bV9wb3N0cyI7czoxOiI1IjtzOjIxOiJteWN1aXNpbmVfZGF0ZV9mb3JtYXQiO3M6NjoiTSBqLCBZIjtzOjI5OiJteWN1aX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dWlzaW5lX2ludGVncmF0aW9uX2hlYWQiO3M6MDoiIjtzOjI2OiJteWN1aXNpbmVfaW50ZWdyYXRpb25fYm9keSI7czowOiIiO3M6MzI6Im15Y3Vpc2luZV9pbnRlZ3JhdGlvbl9zaW5nbGVfdG9wIjtzOjA6IiI7czozNToibXljdWlzaW5lX2ludGVncmF0aW9uX3NpbmdsZV9ib3R0b20iO3M6MDoiIjtzOjIwOiJteWN1aXNpbmVfNDY4X2VuYWJsZSI7TjtzOjE5OiJteWN1aXNpbmVfNDY4X2ltYWdlIjtzOjA6IiI7czoxNzoibXljdWlzaW5lXzQ2OF91cmwiO3M6MDoiIjtzOjIxOiJteWN1aXNpbmVfNDY4X2Fkc2Vuc2UiO3M6MDoiIjt9';
	
	global $options;
	
	foreach ($options as $value) {
		if( isset( $value['id'] ) ) { 
			update_option( $value['id'], $value['std'] );
		}
	}
	
	$importedOptions = unserialize(base64_decode($importOptions));
	
	foreach ($importedOptions as $key=>$value) {
		if ($value != '') update_option( $key, $value );
	}
} ?>